﻿using System;
using System.Collections.Generic;
using System.Collections;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace StackRealization
{
    class Program
    {
        static void Main(string[] args)
        {
            MyStack stck = new MyStack();
            for (int i = 0; i < 5; i++)
            {
                stck.Push(Console.ReadLine());
            }
            //stck.Clear();

            Console.WriteLine();
            Console.WriteLine("How many elements you want to pop from collection.");
            int choice = Int32.Parse(Console.ReadLine());
            Console.WriteLine();
            for (int i = 0; i < choice; i++)
            {
                Console.WriteLine(stck.Pop());
            }

            Console.WriteLine("There are next elements left in the collection:");
            stck.ElementsLeft();
        }
    }
}
